import { ChangeEventHandler, Dispatch, SetStateAction, useState } from "react";

export function useInputState(initialState: string | (() => string)): [string, ChangeEventHandler<HTMLInputElement>, Dispatch<SetStateAction<string>>] {
  const [state, set_state] = useState(initialState);
  return [state, (event) => set_state(event.target.value), set_state];
}